﻿<UserControl x:Class="Torrenter.Client.Main.Views.ShowsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:cal="http://www.caliburnproject.org"
             xmlns:mocks="clr-namespace:Torrenter.Client.Main.Mocks" mc:Ignorable="d" 
             d:DataContext="{d:DesignInstance mocks:ShowsViewModelMock,
                                              IsDesignTimeCreatable=True}"
             d:DesignHeight="300" d:DesignWidth="400">
    <Grid>
        <DataGrid ItemsSource="{Binding Shows}" AutoGenerateColumns="False" IsReadOnly="True">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Name" Binding="{Binding ShowName}" />
                <DataGridTextColumn Header="Last Episode Found" Binding="{Binding LastEpisodeFound}" />
                <DataGridTextColumn Header="Next Episode To Find" Binding="{Binding NextEpisode}" />
                <DataGridTemplateColumn Header="Remove" >
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button cal:Message.Attach="RemoveShow($dataContext)" Background="Transparent" >X</Button>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</UserControl>
